package compiler.ast;

import java.io.PrintStream;

import compiler.symboltable.SymbolTable;
import compiler.tac.ThreeAddressCode;

public class ASTRoot {
	private Module module;
	
	public ASTRoot(Module m) {
		this.module = m;
	}
	
	public SymbolTable getSymbolTable() {
		return module.getVars();
	}
	
	public void printAST(PrintStream out) {
		out.println("digraph AST {\nnode [shape=record];");
		module.printDotFormat(out, "node0");
		out.println("}");
	}

	public ThreeAddressCode toThreeAddressCode() {
		return module.toThreeAddressCode();
	}
}
